<html>
<title>Google Discovery API Sample</title>
<body>
<h2>Instructions for the Google API Discovery Service Sample (<a
  href="http://goo.gl/cKxzB">http://goo.gl/cKxzB</a>)</h2>

<h3>Usage</h3>

Examples using <b><code>google call</code></b>:

<pre><code>  google call discovery v1 apis.getRest plus v1
  google call plus v1 activities.list me public --max-results 3
  google call calendar v3 calendarList.list
  echo {\"summary\":\"temporary calendar\"} > post.json && google call calendar v3 calendars.insert post.json
</code></pre>

Examples using <b><code>google discover</code></b>:

<pre><code>  google discover
  google discover plus v1
  google discover moderator v1</code></pre>

<h3>Browse Online</h3>

<ul>
  <li><a
    href="http://code.google.com/p/google-api-java-client/source/browse?repo=samples#hg/discovery-cmdline-sample">Browse
  Source</a>, or main file <a
    href="http://code.google.com/p/google-api-java-client/source/browse/discovery-cmdline-sample/src/main/java/com/google/api/services/samples/discovery/cmdline/DiscoverySample.java?repo=samples">DiscoverySample.java</a></li>
</ul>

<h3>Installation Instructions</h3>

<p><b>Prerequisites:</b> install <a href="http://java.com">Java 6</a>, <a
  href="http://mercurial.selenic.com/">Mercurial</a> and <a
  href="http://maven.apache.org/download.html">Maven</a>. You may need to set
your <code>JAVA_HOME</code>.</p>

<p><b>Important:</b> after checking out the project, and before compiling
and running it, you need to edit <code>client_secrets.json</code> to
enter the required credentials information (see <a
href="http://code.google.com/p/google-api-java-client/source/browse/shared/shared-sample-cmdline/src/main/java/com/google/api/services/samples/shared/cmdline/oauth2/OAuth2ClientCredentials.java?repo=samples"
>instructions</a>). Otherwise, you will get a <code>400
INVALID_CLIENT</code> error in the browser.</p>

<pre><code>cd <i>[someDirectory]</i>
hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples
cd google-api-java-client-samples/shared/shared-sample-cmdline
<i>[editor]</i> src/main/resources/client_secrets.json
mvn source:jar install
cd ../../discovery-cmdline-sample
mvn assembly:assembly
alias google="<i>[someDirectory]</i>/google-api-java-client-samples/discovery-cmdline-sample/run_sample"</code></pre>

</body>
</html>
